﻿@{
    ViewData["Title"] = "视频添加水印";

    var layoutSelectList = new List<SelectListItem>()
{
        new SelectListItem(){ Text="左上方",Value="1"},
        //new SelectListItem(){ Text="顶部中间",Value="2"},
        new SelectListItem(){ Text="右上方",Value="3"},
        //new SelectListItem(){ Text="左边",Value="4"},
        new SelectListItem(){ Text="正中间",Value="5"},
        //new SelectListItem(){ Text="右边",Value="6"},
        new SelectListItem(){ Text="左下方",Value="7"},
        //new SelectListItem(){ Text="底部中间",Value="8"},
        new SelectListItem(){ Text="右下方",Value="9"},
    };
}

<div class="content">
    <div class="content-body">
        <div class="tool-title clearfix">
            <h1 class="tool-name">视频添加水印</h1>
        </div>
        <form asp-action="UpdateVideoAddWatermark" asp-controller="video" class="form-horizontal"
              enctype="multipart/form-data" data-ajax="true" data-ajax-success="OnSuccess" data-ajax-failure="onFailed" data-ajax-method="post">

            <input type="file" name="files" accept="application/video" style="display:none">

            <div class="row">
                <div class="col-lg-2">
                </div><input type="hidden" name="OldPath" value="" class="file-path" />
                <input type="file" accept="" name="file" style="display:none;" onchange="Upload(this)">
                <a href="javascript:;" class="a-btn" onclick="$(this).prev().trigger('click')">上传视频</a>
            </div>
            <div class="row">
                <div class="col-lg-2"></div>
                <div class="upload-list">
                </div>
            </div>
            <div class="row">
                <div class="col-lg-2"></div>
                <label class="control-label col-md-1 ">水印类型：</label>
                <div class="col-lg-4">
                    <div class="btn-radio">
                        <input type="radio" name="type" value="text" onclick="SwitchType('.type-text')" checked />文字
                        <input type="radio" name="type" value="img" onclick="SwitchType('.type-img')" />图片
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-2"></div>
                <label class="control-label col-md-1">水印布局：</label>
                <div class="col-lg-4">
                    <select name="layout" class="form-control">
                        @foreach (var item in layoutSelectList)
                        {
                            <option value="@item.Value">@item.Text</option>
                        }
                    </select>
                </div>
            </div>

            <div class="row type-text" data-type="switch-type">
                <div class="col-lg-2"></div>
                <label class="control-label col-md-1">水印文字：</label>
                <div class="col-lg-4">
                    <input type="text" name="waterMarkName" placeholder="" autocomplete="off" class="form-control">
                </div>
            </div>
            <div class="row type-img" style="display:none;" data-type="switch-type">
                <div class="col-lg-2"></div>
                <input type="hidden" name="WatermarkPath" value="" class="file-path" />
                <input type="file" accept="" name="file" style="display:none;" onchange="Upload(this)">
                <a href="javascript:;" class="a-btn" onclick="$(this).prev().trigger('click')">上传图片</a>
            </div>
            <div class="row type-img" data-type="switch-type">
                <div class="col-lg-2"></div>
                <div class="upload-list">
                </div>
            </div>
            <a href="javascript:;" class="a-btn" onclick="$('form').submit()">提交</a>

            <a href="javascript:;" class="a-btn down-btn" target="_blank" style="display:none;">保存</a>
        </form>
    </div>
</div>

@section scripts{
    <script src="~/js/jquery-validate/jquery.unobtrusive-ajax.js"></script>
}